package com.shop.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)

//22
public class Article implements Serializable {
    private String id; //文章id编号
    private String title; // 文章标题
    private String content; // 文章内容
    private String authorId; //作者编号

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date create_date; // 创建时间
    private int readcount; // 阅读次数
    private int commentcount; // 评论次数
    private int likecount; // 喜欢次数

    public Article(String id, String title, String content, String authorId, Date create_date) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.authorId = authorId;
        this.create_date = create_date;
    }
}

